-
Notifications
You must be signed in to change notification settings - Fork 1
[BB-282] add sync secrets #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pkg/connector/team.go
Outdated
|
|
||
| for _, team := range teams { | ||
| fullTeam, _, err := o.client.Teams.GetTeamByID(ctx, orgID, team.GetID()) | ||
| fullTeam, _, err := o.client.Teams.GetTeamBySlug(ctx, fmt.Sprintf("%v", orgID), fmt.Sprintf("%v", team.GetID())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change caused syncs to fail for me with a 404.
{"level":"error","ts":1744830589.5247319,"caller":"ugrpc/logging.go:35","msg":"finished unary call with code Unknown","grpc.start_time":"2025-04-16T12:09:49-07:00","grpc.service":"c1.connector.v2.ResourcesService","grpc.method":"ListResources","peer.address":"127.0.0.1:52850","error":"error: listing resources failed: GET https://api.github.com/orgs/82982809/teams/4820527: 404 Not Found []","grpc.code":"Unknown","grpc.time_ms":244.131}
I think you want
fullTeam, _, err := o.client.Teams.GetTeamBySlug(ctx, orgName, team.GetSlug())
The same goes for the other API calls that get a team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, fixed
|
It would also be nice if the CI tests synced secrets so that this code was tested. |
|
@btipling do you know if we're syncing class github tokens as well? or just the new fine grained access tokens? |
only fine grained access tokens |
btipling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment
pkg/connector/api_token.go
Outdated
| type apiTokenResourceType struct { | ||
| resourceType *v2.ResourceType | ||
| client *github.Client | ||
| hasSAMLEnabled *bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unused, seems to be copy pasted from user.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
1c94ed3 to
74ff2eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually after rebasing I see it is using a slug as an id. I am not sure my rebase is correct, also we can't use a slug as an id, we can only use the id as an id. The slug is not an identifier we should not use it as an identifier, if the id not enough information we need to add more information to the id. Although, we should also not update ids as they will churn stuff. I hope we don't need the slug and everything is in the id.
only reason I made the change to slug is because the method |
0714ec4 to
8fac5be
Compare
update readme fix config file fix github deprecated calls fix github deprecated calls 2 fix lint warnings refactor resource type add secrets resource fix github deprecated calls fix getUserBySlug using id instead of name, remove dead code fix lint fix readme update golangci-lint use v8
8fac5be to
32500bb
Compare
No description provided.